/**
 * 
 */
package travibot.core.tags;


/**
 * @author tajzivit
 *
 */
public class Input extends HTML {

    public enum InputType{
        
        HIDDEN, TEXT, PASSWORD;
    }
    
    private String clazz;
    private InputType type;
    private String name;
    private String value;
    
    public String getClazz() {
    
        return clazz;
    }
    
    public void setClazz(String clazz) {
    
        this.clazz = clazz;
    }
    
    public String getName() {
    
        return name;
    }
    
    public void setName(String name) {
    
        this.name = name;
    }
    
    public InputType getType() {
    
        return type;
    }
    
    public void setType(InputType type) {
    
        this.type = type;
    }
    
    public String getValue() {
    
        return value;
    }
    
    public void setValue(String value) {
    
        this.value = value;
    }

    public Input(String clazz, InputType type, String name, String value) {

        super();
        this.clazz = clazz;
        this.type = type;
        this.name = name;
        this.value = value;
    }
    
    public Input(String clazz, String type, String name, String value) {

        super();
        this.clazz = clazz;
        this.name = name;
        this.value = value;
        this.type = getInputType(type);
        
    }
    
    public static InputType getInputType(String type){
        
        if(type.toLowerCase().equals("hidden"))
            return InputType.HIDDEN;
        else if(type.toLowerCase().equals("password"))
            return InputType.PASSWORD;
        else
            return InputType.TEXT;
    }
}
